Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging configuration #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add logging configuration #50

wants to merge 1 commit into from

Conversation

bjin96
Copy link

@bjin96 bjin96 commented Aug 3, 2024

Adds a logging configuration for Django.

This will create a log file in the intranet cage under /var/www/eshc-intranet/debug.log. The file fills up to 10 MB and then archives older logs in up to 5 backup files. Hopefully, this will help us find problems with the intranet more quickly.

The logging will already outoput Django errors, but we might want to add custom logging to get better insight gradually. Generally this would be:

import logging

logger = logging.getLogger(__name__)

at the start of the file, and then use:

logger.<LOG_LEVEL>('This is a logging message')

where LOG_LEVEL is one of the logging levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant